package com.lagou.rpc.consumer.controller;

import com.lagou.rpc.api.ITestRPCService;
import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author stevejson
 */

@RestController
public class RPCController {

    @Autowired
    private IUserService userService;

    @Autowired
    private ITestRPCService testRPCService;

    @RequestMapping("/active")
    public Object active(){
        return testRPCService.active();
    }

    @RequestMapping("/user")
    public Object getUser(Integer id){
        User user = userService.getById(id);
        System.out.println(user);
        return user;
    }

}
